/** 
*\brief
* This is WFUrlProcessor class
* This class handles url processing, including parsing url and validating url
*\author Lucy Lu
*/
var WFUrlProcessor = new Class({
    strUrl: "",
    objUrl: null,
    initialize: function (url) {   
        this.strUrl = url;
        this.objUrl = parseUrl(url);             
    },
    isValid: function(){
        if (this.objUrl != null){
            if (!this.isValidHost()){
                return false;          
            }

            if (this.objUrl.port != ""){
                return this.isValidPort();
            }
            return true;
        }else{
            return false;    
        }
    },
    isValidHost: function(){
        if (this.objUrl != null){
            return isValidHost(this.objUrl.host);
        }else{
            return false;
        }
    },
    isValidPort: function(){
        if (this.objUrl != null){
            return isValidPort(this.objUrl.port);
        }else{
            return false;
        }
    }
});
